
//
// 130419 - AH - Created.
//

package org.japril.servlet.xmlservlet;

import java.io.IOException;

/**
 * <p>
 *   Interface for objects that initializes the environment for handling a
 *   request for a 
 *   {@link XmlRequestServlet}.
 * </p>
 * @author Arne Halvorsen (AH)
 */
public interface EnvironmentInitializer 
{
  /**
   * <p>
   *   Initialize environment.
   * </p>
   * @param xml XML.
   * @return Object to be passed to 
   *         {@link EngineHandler} that is result of initialization, may be
   *         {@code null}.
   */
  public Object initialize(String xml) throws IOException;
  
  /**
   * <p>
   *   Gets
   *   {@link EngineHandler} to use.
   * </p>
   * @return Handler or {@code null} if non produced.
   */
  public EngineHandler getEngineHandler();
  
  /**
   * <p>
   *   Gets 
   *   {@link ResponseHandler} to use. 
   * </p>
   * @return Handler or {@code null} if non produced.
   */
  public ResponseHandler getResponseHandler();
  
}
